package com.paul.sys.service.impl;

import com.paul.sys.mapper.DepartmentMapper;
import com.paul.sys.model.Department;
import com.paul.sys.service.DepartmentService;
import com.paul.sys.tools.CommPageBean;
import com.paul.sys.tools.PageData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class DepartmentServiceImpl implements DepartmentService{

    @Autowired
    private DepartmentMapper departmentMapper;

//    @Override
//    onpublic void insert(Department record) {
//        departmentMapper.insert(record);
//    }
//
//    @Override
//    onpublic Department select(Map<String, String> param) {
//        return departmentMapper.select(param);
//    }


    @Override
    public PageData<Department> listByPage(Map<String, String> param) {
        PageData<Department> pageData = new PageData<Department>();
        CommPageBean pageBean = CommPageBean.getPageBeanByParam(param);
        List<Department> list = departmentMapper.listByPage(param, pageBean);
        pageData.setPageBean(pageBean);
        pageData.setListData(list);
        return pageData;
    }
    @Override
    public List<Department> listAll(Map<String, String> param){
        return departmentMapper.listAll(param);
    }
}